/*
 * VentanaPrincipal.java
 *
 * Created on 21 de agosto de 2008, 12:02
 */

package abstraccionhardware;

import dao.ContenedorDao;
import dao.implementacion.ContenedorDaoImp;
import dominio.Comando;
import dominio.Contenedor;
import java.awt.Dimension;
import javax.swing.JLabel;
import javax.swing.JSlider;
import shell.Kernel;
import java.awt.Image;
import java.awt.MouseInfo;
import java.awt.Point;
import java.awt.PointerInfo;
import java.awt.Toolkit;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import javax.swing.DefaultListModel;
import javax.swing.ImageIcon;
import javax.swing.JList;
import vista.Panel;
import vista.VentanaNuevaMusica;
import vista.VentanaNuevaReceta;
import vista.VentanaNuevoAlimento;
import vista.VentanaNuevoCanal;
import vista.VentanaNuevoContenedor;
import vista.VentanaNuevoContexto;
import vista.VentanaNuevoEstadoAnimo;
import vista.VentanaNuevoPerfil;





/**
 *
 * @author  marcelo
 */
public class VentanaPrincipal extends javax.swing.JFrame
{

    private Kernel kernel;
//    private boolean puerta1 = true;
//    private boolean puerta2 = true;
//    private boolean puerta3 = true;
//    private boolean puerta4 = true;
//    private boolean puerta5 = true;
//    private boolean puerta6 = true;
//    private boolean puerta7 = true;
//    private boolean ventana1 = false;
//    private boolean ventana2 = false;
//    private boolean ventana3 = false;
//    private boolean ventana4 = false;

    private DefaultListModel jListModelo = new DefaultListModel();
    private Collection elementos = new ArrayList();
    private Collection contenedores = new ArrayList();
    private double xCentro, yCentro;

    /** Creates new form VentanaPrincipal */
    public VentanaPrincipal() 
    {
        initComponents();
        
//        VentanaPrincipalImg panel = new VentanaPrincipalImg();
//        ImageIcon imagenFondo = new ImageIcon(getClass().getResource("imagenes/esquema.jpg"));
//        Panel panel = new Panel();
//        this.add(panel);
//        this.pack();
//        this.setLocation(0, 20);
        this.inicializar();
    }

    public VentanaPrincipal(Kernel kernel)
    {
//        setDefaultLookAndFeelDecorated(false);
        initComponents();
//        this.setLocation(0, 20);
        this.inicializar();
        this.kernel = kernel;
        this.xCentro = this.jLabelCarita.getHeight()/2;
        this.yCentro = this.jLabelCarita.getWidth()/2;
    }
    
    

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroupSensores = new javax.swing.ButtonGroup();
        panel1 = new vista.Panel();
        jLabelCarita = new javax.swing.JLabel();
        panel2 = new vista.Panel();
        jLabelPuerta1 = new javax.swing.JLabel();
        jLabelPuerta2 = new javax.swing.JLabel();
        jLabelPuerta5 = new javax.swing.JLabel();
        jLabelPuerta6 = new javax.swing.JLabel();
        jLabelVentana1 = new javax.swing.JLabel();
        jLabelVentana2 = new javax.swing.JLabel();
        jLabelVentana3 = new javax.swing.JLabel();
        jLabelPuerta7 = new javax.swing.JLabel();
        jLabelVentana4 = new javax.swing.JLabel();
        jLabelPuerta4 = new javax.swing.JLabel();
        jLabelPuerta3 = new javax.swing.JLabel();
        jSliderTemperaturaAmbiente = new javax.swing.JSlider();
        jLabelTemperatura = new javax.swing.JLabel();
        jPanel1 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jListElementos = new javax.swing.JList();
        jTextFieldCantidad = new javax.swing.JTextField();
        jPanel2 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabelNombrePerfil = new javax.swing.JLabel();
        jPanel3 = new javax.swing.JPanel();
        jSliderIntesidadLuzAmbiente = new javax.swing.JSlider();
        jButtonPerfiles = new javax.swing.JButton();
        jButtonAlimentos = new javax.swing.JButton();
        jButtonRecetas = new javax.swing.JButton();
        jButtonSalir = new javax.swing.JButton();
        jPanel4 = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jScrollPane2 = new javax.swing.JScrollPane();
        jList1 = new javax.swing.JList();
        jTextFieldComando = new javax.swing.JTextField();
        jTextFieldParametro = new javax.swing.JTextField();
        jTextFieldObjeto = new javax.swing.JTextField();
        jPanel5 = new javax.swing.JPanel();
        jSliderTemperaturaInterior = new javax.swing.JSlider();
        jSliderIntensidadLuz = new javax.swing.JSlider();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenuAdministracion = new javax.swing.JMenu();
        jMenuItemTema = new javax.swing.JMenuItem();
        jMenuItemCanal = new javax.swing.JMenuItem();
        jMenuItemAlimentos = new javax.swing.JMenuItem();
        jMenuItemContenedor = new javax.swing.JMenuItem();
        jMenuItemContexto = new javax.swing.JMenuItem();
        jMenuAyuda = new javax.swing.JMenu();
        jMenuItem1 = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Ventana Principal");
        setResizable(false);

        panel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        panel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/esquema.jpg"))); // NOI18N

        jLabelCarita.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabelCarita.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
        jLabelCarita.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        jLabelCarita.setDebugGraphicsOptions(javax.swing.DebugGraphics.NONE_OPTION);
        jLabelCarita.setDoubleBuffered(true);
        jLabelCarita.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jLabelCarita.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
            public void mouseDragged(java.awt.event.MouseEvent evt) {
                jLabelCaritaMouseDragged(evt);
            }
        });

        javax.swing.GroupLayout panel1Layout = new javax.swing.GroupLayout(panel1);
        panel1.setLayout(panel1Layout);
        panel1Layout.setHorizontalGroup(
            panel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panel1Layout.createSequentialGroup()
                .addContainerGap(401, Short.MAX_VALUE)
                .addComponent(jLabelCarita, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(334, 334, 334))
        );
        panel1Layout.setVerticalGroup(
            panel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panel1Layout.createSequentialGroup()
                .addGap(106, 106, 106)
                .addComponent(jLabelCarita, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(322, Short.MAX_VALUE))
        );

        panel2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        panel2.setDebugGraphicsOptions(javax.swing.DebugGraphics.NONE_OPTION);
        panel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/iluminacionCero.jpg"))); // NOI18N

        jLabelPuerta1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLabelPuerta1MouseClicked(evt);
            }
        });

        jLabelPuerta2.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLabelPuerta2MouseClicked(evt);
            }
        });

        jLabelPuerta5.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLabelPuerta5MouseClicked(evt);
            }
        });

        jLabelPuerta6.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLabelPuerta6MouseClicked(evt);
            }
        });

        jLabelVentana1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLabelVentana1MouseClicked(evt);
            }
        });

        jLabelVentana2.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLabelVentana2MouseClicked(evt);
            }
        });

        jLabelVentana3.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLabelVentana3MouseClicked(evt);
            }
        });

        jLabelPuerta7.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLabelPuerta7MouseClicked(evt);
            }
        });

        jLabelVentana4.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLabelVentana4MouseClicked(evt);
            }
        });

        jLabelPuerta4.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLabelPuerta4MouseClicked(evt);
            }
        });

        jLabelPuerta3.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLabelPuerta3MouseClicked(evt);
            }
        });

        javax.swing.GroupLayout panel2Layout = new javax.swing.GroupLayout(panel2);
        panel2.setLayout(panel2Layout);
        panel2Layout.setHorizontalGroup(
            panel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panel2Layout.createSequentialGroup()
                .addComponent(jLabelVentana1, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(445, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panel2Layout.createSequentialGroup()
                .addGroup(panel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(panel2Layout.createSequentialGroup()
                        .addGroup(panel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(panel2Layout.createSequentialGroup()
                                .addGap(45, 45, 45)
                                .addComponent(jLabelVentana2, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(panel2Layout.createSequentialGroup()
                                .addContainerGap()
                                .addComponent(jLabelPuerta1, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGroup(panel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(panel2Layout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(panel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(panel2Layout.createSequentialGroup()
                                        .addGap(128, 128, 128)
                                        .addComponent(jLabelPuerta2, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(panel2Layout.createSequentialGroup()
                                        .addGap(107, 107, 107)
                                        .addComponent(jLabelPuerta4, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE))))
                            .addGroup(panel2Layout.createSequentialGroup()
                                .addGap(145, 145, 145)
                                .addComponent(jLabelPuerta7, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addGroup(panel2Layout.createSequentialGroup()
                        .addGap(81, 81, 81)
                        .addComponent(jLabelPuerta5, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(36, 36, 36)
                .addGroup(panel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panel2Layout.createSequentialGroup()
                        .addGroup(panel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabelPuerta3, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabelVentana4, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(103, 103, 103))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panel2Layout.createSequentialGroup()
                        .addGroup(panel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabelPuerta6, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabelVentana3, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(35, 35, 35))))
        );
        panel2Layout.setVerticalGroup(
            panel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabelVentana1, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panel2Layout.createSequentialGroup()
                        .addComponent(jLabelPuerta3, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 180, Short.MAX_VALUE)
                        .addComponent(jLabelVentana4, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(panel2Layout.createSequentialGroup()
                        .addGroup(panel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(panel2Layout.createSequentialGroup()
                                .addGroup(panel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabelPuerta2, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabelPuerta1, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(panel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addGroup(panel2Layout.createSequentialGroup()
                                        .addGap(64, 64, 64)
                                        .addComponent(jLabelPuerta4, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(18, 18, 18)
                                        .addComponent(jLabelPuerta7, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(panel2Layout.createSequentialGroup()
                                        .addGap(8, 8, 8)
                                        .addComponent(jLabelPuerta5, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(jLabelVentana2, javax.swing.GroupLayout.PREFERRED_SIZE, 57, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(15, 15, 15))))
                            .addGroup(panel2Layout.createSequentialGroup()
                                .addGap(69, 69, 69)
                                .addComponent(jLabelPuerta6, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(33, 33, 33)
                                .addComponent(jLabelVentana3, javax.swing.GroupLayout.PREFERRED_SIZE, 57, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addContainerGap(22, Short.MAX_VALUE))))
        );

        jSliderTemperaturaAmbiente.setMajorTickSpacing(5);
        jSliderTemperaturaAmbiente.setMaximum(50);
        jSliderTemperaturaAmbiente.setMinorTickSpacing(1);
        jSliderTemperaturaAmbiente.setPaintLabels(true);
        jSliderTemperaturaAmbiente.setPaintTicks(true);
        jSliderTemperaturaAmbiente.setValue(25);
        jSliderTemperaturaAmbiente.setBorder(javax.swing.BorderFactory.createTitledBorder("Temperatura"));
        jSliderTemperaturaAmbiente.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jSliderTemperaturaAmbienteMouseExited(evt);
            }
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                jSliderTemperaturaAmbienteMouseReleased(evt);
            }
        });
        jSliderTemperaturaAmbiente.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jSliderTemperaturaAmbienteStateChanged(evt);
            }
        });

        jLabelTemperatura.setFont(new java.awt.Font("Tahoma", 0, 18));
        jLabelTemperatura.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabelTemperatura.setText("25");
        jLabelTemperatura.setBorder(javax.swing.BorderFactory.createTitledBorder("Temperatura"));

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Elementos en heladera"));

        jListElementos.setModel(this.jListModelo);
        jListElementos.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jListElementosMouseClicked(evt);
            }
        });
        jScrollPane1.setViewportView(jListElementos);

        jTextFieldCantidad.setBackground(javax.swing.UIManager.getDefaults().getColor("Button.background"));
        jTextFieldCantidad.setFont(new java.awt.Font("Tahoma", 0, 28));
        jTextFieldCantidad.setForeground(new java.awt.Color(0, 102, 255));
        jTextFieldCantidad.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        jTextFieldCantidad.setBorder(javax.swing.BorderFactory.createTitledBorder("Cantidad"));
        jTextFieldCantidad.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                jTextFieldCantidadKeyPressed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 174, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTextFieldCantidad, javax.swing.GroupLayout.PREFERRED_SIZE, 147, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jTextFieldCantidad, javax.swing.GroupLayout.DEFAULT_SIZE, 106, Short.MAX_VALUE)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 106, Short.MAX_VALUE)
        );

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Perfil Activo"));

        jLabel1.setBackground(new java.awt.Color(255, 255, 204));
        jLabel1.setText("Nombre");
        jLabel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jLabel1.setOpaque(true);

        jLabelNombrePerfil.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabelNombrePerfil.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabelNombrePerfil, javax.swing.GroupLayout.PREFERRED_SIZE, 171, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelNombrePerfil, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Intensidad de luz"));

        jSliderIntesidadLuzAmbiente.setMajorTickSpacing(5);
        jSliderIntesidadLuzAmbiente.setMinorTickSpacing(5);
        jSliderIntesidadLuzAmbiente.setPaintLabels(true);
        jSliderIntesidadLuzAmbiente.setPaintTicks(true);

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addComponent(jSliderIntesidadLuzAmbiente, javax.swing.GroupLayout.DEFAULT_SIZE, 373, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jSliderIntesidadLuzAmbiente, javax.swing.GroupLayout.DEFAULT_SIZE, 53, Short.MAX_VALUE)
        );

        jButtonPerfiles.setText("Perfiles");
        jButtonPerfiles.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonPerfilesActionPerformed(evt);
            }
        });

        jButtonAlimentos.setText("Alimentos");
        jButtonAlimentos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonAlimentosActionPerformed(evt);
            }
        });

        jButtonRecetas.setText("Recetas");
        jButtonRecetas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonRecetasActionPerformed(evt);
            }
        });

        jButtonSalir.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/exit00c.gif"))); // NOI18N
        jButtonSalir.setToolTipText("Salir del sistema");
        jButtonSalir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonSalirActionPerformed(evt);
            }
        });

        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder("Interprete de comandos"));

        jLabel2.setText("Comando");

        jLabel3.setText("Objeto");

        jLabel4.setText("Parametro");

        jList1.setModel(new DefaultListModel());
        jScrollPane2.setViewportView(jList1);

        jTextFieldComando.setBackground(new java.awt.Color(255, 255, 204));

        jTextFieldParametro.setBackground(new java.awt.Color(255, 255, 204));

        jTextFieldObjeto.setBackground(new java.awt.Color(255, 255, 204));
        jTextFieldObjeto.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTextFieldObjetoKeyReleased(evt);
            }
        });

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jTextFieldObjeto, javax.swing.GroupLayout.DEFAULT_SIZE, 115, Short.MAX_VALUE)
                    .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, 115, Short.MAX_VALUE)
                    .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 115, Short.MAX_VALUE)
                    .addComponent(jTextFieldComando, javax.swing.GroupLayout.DEFAULT_SIZE, 115, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jTextFieldParametro, javax.swing.GroupLayout.DEFAULT_SIZE, 115, Short.MAX_VALUE)
                    .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, 115, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 196, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(12, 12, 12))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel2)
                            .addComponent(jLabel4))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jTextFieldComando, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jTextFieldParametro, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTextFieldObjeto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 113, Short.MAX_VALUE))
                .addContainerGap())
        );

        jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder("Medidas internas"));

        jSliderTemperaturaInterior.setMajorTickSpacing(5);
        jSliderTemperaturaInterior.setMaximum(50);
        jSliderTemperaturaInterior.setMinorTickSpacing(1);
        jSliderTemperaturaInterior.setPaintLabels(true);
        jSliderTemperaturaInterior.setPaintTicks(true);
        jSliderTemperaturaInterior.setValue(25);
        jSliderTemperaturaInterior.setBorder(javax.swing.BorderFactory.createTitledBorder("Temperatura"));
        jSliderTemperaturaInterior.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jSliderTemperaturaInteriorMouseExited(evt);
            }
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                jSliderTemperaturaInteriorMouseReleased(evt);
            }
        });
        jSliderTemperaturaInterior.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jSliderTemperaturaInteriorStateChanged(evt);
            }
        });

        jSliderIntensidadLuz.setMajorTickSpacing(5);
        jSliderIntensidadLuz.setMinorTickSpacing(1);
        jSliderIntensidadLuz.setPaintLabels(true);
        jSliderIntensidadLuz.setPaintTicks(true);
        jSliderIntensidadLuz.setValue(25);
        jSliderIntensidadLuz.setBorder(javax.swing.BorderFactory.createTitledBorder("Intensidad de Luz"));
        jSliderIntensidadLuz.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jSliderIntensidadLuzMouseExited(evt);
            }
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                jSliderIntensidadLuzMouseReleased(evt);
            }
        });
        jSliderIntensidadLuz.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jSliderIntensidadLuzStateChanged(evt);
            }
        });

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addGap(20, 20, 20)
                .addComponent(jSliderIntensidadLuz, javax.swing.GroupLayout.DEFAULT_SIZE, 386, Short.MAX_VALUE)
                .addContainerGap())
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
                .addContainerGap(65, Short.MAX_VALUE)
                .addComponent(jSliderTemperaturaInterior, javax.swing.GroupLayout.PREFERRED_SIZE, 304, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(47, 47, 47))
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jSliderTemperaturaInterior, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 29, Short.MAX_VALUE)
                .addComponent(jSliderIntensidadLuz, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        jSliderIntensidadLuz.getAccessibleContext().setAccessibleName("Intensidad de luz");
        jSliderIntensidadLuz.getAccessibleContext().setAccessibleDescription("");

        jMenuAdministracion.setText("Administracion");

        jMenuItemTema.setText("Tema Musical ...");
        jMenuItemTema.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemTemaActionPerformed(evt);
            }
        });
        jMenuAdministracion.add(jMenuItemTema);

        jMenuItemCanal.setText("Canal de Television ...");
        jMenuItemCanal.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemCanalActionPerformed(evt);
            }
        });
        jMenuAdministracion.add(jMenuItemCanal);

        jMenuItemAlimentos.setText("Alimentos...");
        jMenuItemAlimentos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemAlimentosActionPerformed(evt);
            }
        });
        jMenuAdministracion.add(jMenuItemAlimentos);

        jMenuItemContenedor.setText("Contenedor...");
        jMenuItemContenedor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemContenedorActionPerformed(evt);
            }
        });
        jMenuAdministracion.add(jMenuItemContenedor);

        jMenuItemContexto.setText("Contextos...");
        jMenuItemContexto.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemContextoActionPerformed(evt);
            }
        });
        jMenuAdministracion.add(jMenuItemContexto);

        jMenuBar1.add(jMenuAdministracion);

        jMenuAyuda.setText("Ayuda");

        jMenuItem1.setText("Ver");
        jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem1ActionPerformed(evt);
            }
        });
        jMenuAyuda.add(jMenuItem1);

        jMenuBar1.add(jMenuAyuda);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(panel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(panel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(layout.createSequentialGroup()
                                .addGap(10, 10, 10)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jSliderTemperaturaAmbiente, javax.swing.GroupLayout.PREFERRED_SIZE, 304, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGroup(layout.createSequentialGroup()
                                        .addGap(109, 109, 109)
                                        .addComponent(jLabelTemperatura, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGap(18, 18, 18)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jButtonRecetas, javax.swing.GroupLayout.DEFAULT_SIZE, 115, Short.MAX_VALUE)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                .addComponent(jButtonSalir)
                                .addComponent(jButtonPerfiles, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jButtonAlimentos, javax.swing.GroupLayout.DEFAULT_SIZE, 115, Short.MAX_VALUE)))))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(479, 479, 479)
                .addComponent(jSliderTemperaturaAmbiente, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(71, 71, 71))
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(panel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(panel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(layout.createSequentialGroup()
                                .addGap(80, 80, 80)
                                .addComponent(jLabelTemperatura)))
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(layout.createSequentialGroup()
                                .addGap(15, 15, 15)
                                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addGroup(layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jPanel5, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGroup(layout.createSequentialGroup()
                                .addGap(29, 29, 29)
                                .addComponent(jButtonRecetas)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup()
                                        .addGap(29, 29, 29)
                                        .addComponent(jButtonPerfiles))
                                    .addComponent(jButtonAlimentos))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 38, Short.MAX_VALUE)
                                .addComponent(jButtonSalir, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addContainerGap())))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jMenuItemTemaActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jMenuItemTemaActionPerformed
    {//GEN-HEADEREND:event_jMenuItemTemaActionPerformed
        // TODO add your handling code here:
        VentanaNuevaMusica nuevaMusica = new VentanaNuevaMusica();
        nuevaMusica.setVisible(true);
    }//GEN-LAST:event_jMenuItemTemaActionPerformed

    private void jMenuItemCanalActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jMenuItemCanalActionPerformed
    {//GEN-HEADEREND:event_jMenuItemCanalActionPerformed
        // TODO add your handling code here:
        VentanaNuevoCanal nuevoCanal = new VentanaNuevoCanal();
        nuevoCanal.setVisible(true);
    }//GEN-LAST:event_jMenuItemCanalActionPerformed

    private void jMenuItemAlimentosActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jMenuItemAlimentosActionPerformed
    {//GEN-HEADEREND:event_jMenuItemAlimentosActionPerformed
        // TODO add your handling code here:
        VentanaNuevoAlimento nuevoAlimento = new VentanaNuevoAlimento();
        nuevoAlimento.setVisible(true);
    }//GEN-LAST:event_jMenuItemAlimentosActionPerformed

    private void jMenuItemContenedorActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jMenuItemContenedorActionPerformed
    {//GEN-HEADEREND:event_jMenuItemContenedorActionPerformed
        // TODO add your handling code here:
        VentanaNuevoContenedor nuevoContenedor = new VentanaNuevoContenedor();
        nuevoContenedor.setVisible(true);
    }//GEN-LAST:event_jMenuItemContenedorActionPerformed

    private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jMenuItem1ActionPerformed
    {//GEN-HEADEREND:event_jMenuItem1ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jMenuItem1ActionPerformed

    private void jMenuItemContextoActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jMenuItemContextoActionPerformed
    {//GEN-HEADEREND:event_jMenuItemContextoActionPerformed
        // TODO add your handling code here:
        VentanaNuevoContexto nuevoContexto = new VentanaNuevoContexto();
        nuevoContexto.setVisible(true);
    }//GEN-LAST:event_jMenuItemContextoActionPerformed

    private void jLabelCaritaMouseDragged(java.awt.event.MouseEvent evt)//GEN-FIRST:event_jLabelCaritaMouseDragged
    {//GEN-HEADEREND:event_jLabelCaritaMouseDragged
        // TODO add your handling code here:
//        PointerInfo pointerInfo = MouseInfo.getPointerInfo();

//        Point p = pointerInfo.getLocation();
        Point p = new Point();
        p.setLocation(evt.getLocationOnScreen().x, evt.getLocationOnScreen().y);

//        lakdñ{amd p.setLocation(evt.getLocationOnScreen().x-23,evt.getLocationOnScreen().y-97);
//        p.setLocation(evt.getLocationOnScreen().x,evt.getLocationOnScreen().y);
//        String pos = "[ Posicion x="+evt.getPoint().getX();
//        pos = pos+" ; y="+evt.getPoint().getY()+ " ]";
//        System.out.println(pos);
        
        this.mover(p);
//        System.out.println(evt.getLocationOnScreen());
    }//GEN-LAST:event_jLabelCaritaMouseDragged

    private void jLabelPuerta1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelPuerta1MouseClicked
        // TODO add your handling code here:
//        if(this.puerta1)
//            this.cerrarPuerta1();
//        else
//            this.abrirPuerta1();
}//GEN-LAST:event_jLabelPuerta1MouseClicked

    private void jLabelPuerta2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelPuerta2MouseClicked
        // TODO add your handling code here:
//        if(this.puerta2)
//            this.cerrarPuerta2();
//        else
//            this.abrirPuerta2();
}//GEN-LAST:event_jLabelPuerta2MouseClicked

    private void jLabelPuerta4MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelPuerta4MouseClicked
        // TODO add your handling code here:
}//GEN-LAST:event_jLabelPuerta4MouseClicked

    private void jLabelPuerta5MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelPuerta5MouseClicked
        // TODO add your handling code here:
}//GEN-LAST:event_jLabelPuerta5MouseClicked

    private void jLabelPuerta6MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelPuerta6MouseClicked
        // TODO add your handling code here:
}//GEN-LAST:event_jLabelPuerta6MouseClicked

    private void jLabelVentana1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelVentana1MouseClicked
        // TODO add your handling code here:
//        if(this.ventana1)
//            this.cerrarVentana1();
//        else
//            this.abrirVentana1();



    }//GEN-LAST:event_jLabelVentana1MouseClicked

    private void jLabelVentana2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelVentana2MouseClicked
        // TODO add your handling code here:
}//GEN-LAST:event_jLabelVentana2MouseClicked

    private void jLabelVentana3MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelVentana3MouseClicked
        // TODO add your handling code here:
}//GEN-LAST:event_jLabelVentana3MouseClicked

    private void jLabelPuerta7MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelPuerta7MouseClicked
        // TODO add your handling code here:
}//GEN-LAST:event_jLabelPuerta7MouseClicked

    private void jLabelVentana4MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelVentana4MouseClicked
        // TODO add your handling code here:
//        if(this.ventana4)
//            this.cerrarVentana4();
//        else
//            this.abrirVentana4();
}//GEN-LAST:event_jLabelVentana4MouseClicked

    private void jLabelPuerta3MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelPuerta3MouseClicked
        // TODO add your handling code here:
    }//GEN-LAST:event_jLabelPuerta3MouseClicked

    private void jSliderTemperaturaAmbienteMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jSliderTemperaturaAmbienteMouseExited
        // TODO add your handling code here:
    }//GEN-LAST:event_jSliderTemperaturaAmbienteMouseExited

    private void jSliderTemperaturaAmbienteMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jSliderTemperaturaAmbienteMouseReleased
        // TODO add your handling code here:
}//GEN-LAST:event_jSliderTemperaturaAmbienteMouseReleased

    private void jSliderTemperaturaAmbienteStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jSliderTemperaturaAmbienteStateChanged
        // TODO add your handling code here:
        this.cambiarTemperatura();
}//GEN-LAST:event_jSliderTemperaturaAmbienteStateChanged

    private void jListElementosMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jListElementosMouseClicked
        // TODO add your handling code here:
        this.mostrarSeleccion();
}//GEN-LAST:event_jListElementosMouseClicked

    private void jTextFieldCantidadKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextFieldCantidadKeyPressed
        // TODO add your handling code here:
        if(evt.getKeyCode() == 10) {
            this.guardarCantidad();
            this.kernel.updateContenedores();
        }
}//GEN-LAST:event_jTextFieldCantidadKeyPressed

    private void jButtonPerfilesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonPerfilesActionPerformed
        // TODO add your handling code here:
        VentanaNuevoPerfil nuevoPerfil = new VentanaNuevoPerfil();
        nuevoPerfil.setVisible(true);
}//GEN-LAST:event_jButtonPerfilesActionPerformed

    private void jButtonAlimentosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAlimentosActionPerformed
        // TODO add your handling code here:
        VentanaNuevoAlimento ventanaAlimento = new VentanaNuevoAlimento();
        ventanaAlimento.setVisible(true);
}//GEN-LAST:event_jButtonAlimentosActionPerformed

    private void jButtonRecetasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonRecetasActionPerformed
        // TODO add your handling code here:
        VentanaNuevaReceta nuevaReceta = new VentanaNuevaReceta();
        nuevaReceta.setVisible(true);
}//GEN-LAST:event_jButtonRecetasActionPerformed

    private void jButtonSalirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonSalirActionPerformed
        // TODO add your handling code here:
        System.exit(0);
}//GEN-LAST:event_jButtonSalirActionPerformed

    private void jTextFieldObjetoKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextFieldObjetoKeyReleased
        // TODO add your handling code here:
        if(evt.getKeyCode()==10)
        {
            Comando c = new Comando();
            c.setNombre(this.jTextFieldComando.getText());
            c.setObjeto(this.jTextFieldObjeto.getText());
            c.setParmetro(this.jTextFieldParametro.getText());
            this.kernel.analizarComando(c);
        }
    }//GEN-LAST:event_jTextFieldObjetoKeyReleased

    private void jSliderTemperaturaInteriorMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jSliderTemperaturaInteriorMouseExited
        // TODO add your handling code here:
    }//GEN-LAST:event_jSliderTemperaturaInteriorMouseExited

    private void jSliderTemperaturaInteriorMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jSliderTemperaturaInteriorMouseReleased
        // TODO add your handling code here:
    }//GEN-LAST:event_jSliderTemperaturaInteriorMouseReleased

    private void jSliderTemperaturaInteriorStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jSliderTemperaturaInteriorStateChanged
        // TODO add your handling code here:
    }//GEN-LAST:event_jSliderTemperaturaInteriorStateChanged

    private void jSliderIntensidadLuzMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jSliderIntensidadLuzMouseExited
        // TODO add your handling code here:
    }//GEN-LAST:event_jSliderIntensidadLuzMouseExited

    private void jSliderIntensidadLuzMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jSliderIntensidadLuzMouseReleased
        // TODO add your handling code here:
    }//GEN-LAST:event_jSliderIntensidadLuzMouseReleased

    private void jSliderIntensidadLuzStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jSliderIntensidadLuzStateChanged
        // TODO add your handling code here:
    }//GEN-LAST:event_jSliderIntensidadLuzStateChanged

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new VentanaPrincipal().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.ButtonGroup buttonGroupSensores;
    private javax.swing.JButton jButtonAlimentos;
    private javax.swing.JButton jButtonPerfiles;
    private javax.swing.JButton jButtonRecetas;
    private javax.swing.JButton jButtonSalir;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabelCarita;
    private javax.swing.JLabel jLabelNombrePerfil;
    private javax.swing.JLabel jLabelPuerta1;
    private javax.swing.JLabel jLabelPuerta2;
    private javax.swing.JLabel jLabelPuerta3;
    private javax.swing.JLabel jLabelPuerta4;
    private javax.swing.JLabel jLabelPuerta5;
    private javax.swing.JLabel jLabelPuerta6;
    private javax.swing.JLabel jLabelPuerta7;
    private javax.swing.JLabel jLabelTemperatura;
    private javax.swing.JLabel jLabelVentana1;
    private javax.swing.JLabel jLabelVentana2;
    private javax.swing.JLabel jLabelVentana3;
    private javax.swing.JLabel jLabelVentana4;
    private javax.swing.JList jList1;
    private javax.swing.JList jListElementos;
    private javax.swing.JMenu jMenuAdministracion;
    private javax.swing.JMenu jMenuAyuda;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItemAlimentos;
    private javax.swing.JMenuItem jMenuItemCanal;
    private javax.swing.JMenuItem jMenuItemContenedor;
    private javax.swing.JMenuItem jMenuItemContexto;
    private javax.swing.JMenuItem jMenuItemTema;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JSlider jSliderIntensidadLuz;
    private javax.swing.JSlider jSliderIntesidadLuzAmbiente;
    private javax.swing.JSlider jSliderTemperaturaAmbiente;
    private javax.swing.JSlider jSliderTemperaturaInterior;
    private javax.swing.JTextField jTextFieldCantidad;
    private javax.swing.JTextField jTextFieldComando;
    private javax.swing.JTextField jTextFieldObjeto;
    private javax.swing.JTextField jTextFieldParametro;
    private vista.Panel panel1;
    private vista.Panel panel2;
    // End of variables declaration//GEN-END:variables

    private void inicializar()
    {
        this.centrar();
        this.setCarita("SinEmocion.jpg");
        this.inicializarPersianas();
        this.inicializarPuertas();
//        this.inicializarImagenes();
        this.cargarElementos();
//        VentanaResultados v = new VentanaResultados(this.kernel);
//        v.inicializar(this.kernel.getPerfiles());
////        Perfil p = ;
//        this.kernel.setPerfil(v.buscarPerfil("FIESTA"));

    }


    private void centrar()
    {
        Dimension pantalla, cuadro;
	pantalla = Toolkit.getDefaultToolkit().getScreenSize();
	cuadro = this.getSize();
	this.setLocation(((pantalla.width - cuadro.width)/2), (pantalla.height - cuadro.height)/2);
    }

    public void setCarita(String carita)
    {
        ImageIcon i = createImageIcon("/imagenes/"+carita);
        ImageIcon tmpIcon = new ImageIcon(i.getImage().getScaledInstance(this.jLabelCarita.getWidth(), this.jLabelCarita.getHeight(), Image.SCALE_DEFAULT));
        this.jLabelCarita.setIcon(tmpIcon);
    }

    protected static ImageIcon createImageIcon(String path)
    {
        //FrmLogin es el nombre de la clase
        java.net.URL imgURL = VentanaPrincipal.class.getResource(path);
//        System.out.println("Path:" + imgURL.getPath());
        if (imgURL != null)
            return new ImageIcon(imgURL);
        else
            return null;
    }

    private void mover(Point point)
    {
        //aqui hago que el label tome la posicion del puntero en la pantalla
        point.setLocation(point.x-23, point.y-96);
        this.jLabelCarita.setLocation(point);
        this.kernel.cambiarPosicion(point.x, point.y);
    }

//    public void inicializarImagenes()
//    {
//        ImageIcon i = createImageIcon("/imagenes/Puerta Arriba Abierta.jpg");
//        //poner imagen a puerta 1
//        ImageIcon tmpIcon = new ImageIcon(i.getImage().getScaledInstance(this.jLabelPuerta1.getWidth(), this.jLabelPuerta1.getHeight(), Image.SCALE_DEFAULT));
//        this.jLabelPuerta1.setIcon(tmpIcon);
//        //poner imagen puerta 2
//        tmpIcon = new ImageIcon(i.getImage().getScaledInstance(this.jLabelPuerta2.getWidth(), this.jLabelPuerta2.getHeight(), Image.SCALE_DEFAULT));
//        this.jLabelPuerta2.setIcon(tmpIcon);
//        //poner imagen puerta 3
//        tmpIcon = new ImageIcon(i.getImage().getScaledInstance(this.jLabelPuerta3.getWidth(), this.jLabelPuerta3.getHeight(), Image.SCALE_DEFAULT));
//        this.jLabelPuerta3.setIcon(tmpIcon);
//        i = createImageIcon("/imagenes/Puerta Abajo Abierta.jpg");
//        tmpIcon = new ImageIcon(i.getImage().getScaledInstance(this.jLabelPuerta4.getWidth(), this.jLabelPuerta4.getHeight(), Image.SCALE_DEFAULT));
//        this.jLabelPuerta4.setIcon(tmpIcon);
//        i = createImageIcon("/imagenes/Puerta Izquierda Abierta.jpg");
//        tmpIcon = new ImageIcon(i.getImage().getScaledInstance(this.jLabelPuerta5.getWidth(), this.jLabelPuerta5.getHeight(), Image.SCALE_DEFAULT));
//        this.jLabelPuerta5.setIcon(tmpIcon);
//        this.jLabelPuerta6.setIcon(tmpIcon);
//
//        //cargando ventanas
//        i = createImageIcon("/imagenes/Ventana Vertical Cerrada.jpg");
//        tmpIcon = new ImageIcon(i.getImage().getScaledInstance(this.jLabelVentana1.getWidth(), this.jLabelVentana1.getHeight(), Image.SCALE_DEFAULT));
//        this.jLabelVentana1.setIcon(tmpIcon);
//        tmpIcon = new ImageIcon(i.getImage().getScaledInstance(this.jLabelVentana2.getWidth(), this.jLabelVentana2.getHeight(), Image.SCALE_DEFAULT));
//        this.jLabelVentana2.setIcon(tmpIcon);
//        tmpIcon = new ImageIcon(i.getImage().getScaledInstance(this.jLabelVentana3.getWidth(), this.jLabelVentana3.getHeight(), Image.SCALE_DEFAULT));
//        this.jLabelVentana3.setIcon(tmpIcon);
//        i = createImageIcon("/imagenes/Puerta Doble Abierta.jpg");
//        tmpIcon = new ImageIcon(i.getImage().getScaledInstance(this.jLabelPuerta7.getWidth(), this.jLabelPuerta7.getHeight(), Image.SCALE_DEFAULT));
//        this.jLabelPuerta7.setIcon(tmpIcon);
//        i = createImageIcon("/imagenes/Ventana Horizontal Cerrada.jpg");
//        tmpIcon = new ImageIcon(i.getImage().getScaledInstance(this.jLabelVentana4.getWidth(), this.jLabelVentana4.getHeight(), Image.SCALE_DEFAULT));
//        this.jLabelVentana4.setIcon(tmpIcon);
//    }

    //servicios sensores
    private void cargarElementos()
    {
        this.borrarElementos();
        ContenedorDao sql = new ContenedorDaoImp();
        this.contenedores = sql.getAll();
        Iterator it = this.contenedores.iterator();
        DefaultListModel modelo = (DefaultListModel)this.jListElementos.getModel();
        while(it.hasNext())
        {
            Contenedor c = (Contenedor)it.next();
            modelo.addElement(c.getNombre().trim());
            c = null;
        }
        it = null;
        modelo = null;
    }
//
    private void borrarElementos()
    {
            this.jListElementos.removeAll();
    }
//
    private Contenedor buscarElemento(String nombre)
    {
        Contenedor e = new Contenedor();
        Iterator it = this.contenedores.iterator();
        while(it.hasNext())
        {
            e = (Contenedor)it.next();
            if(e.getNombre().trim().equals(nombre.trim()))
                break;
        }
        return e;
    }
//
    private void mostrarSeleccion()
    {
        Contenedor contenedor = this.buscarElemento(String.valueOf(this.jListElementos.getSelectedValue()));
        this.jTextFieldCantidad.setText(String.valueOf(contenedor.getCantidad()));
        contenedor = null;
    }

    private void cambiarTemperatura()
    {
        this.jLabelTemperatura.setText(String.valueOf(this.jSliderTemperaturaInterior.getValue()));
    }

    private void guardarCantidad()
    {
        Contenedor contenedor = this.buscarElemento(String.valueOf(this.jListElementos.getSelectedValue()));
        contenedor.setCantidad(Double.parseDouble(this.jTextFieldCantidad.getText()));
        ContenedorDao sql = new ContenedorDaoImp();
        sql.modificar(contenedor);
        this.kernel.setPeso();
    }

    public void setIntesidadLuz(int luz)
    {
        this.jSliderIntensidadLuz.setValue(luz);
    }


    private void inicializarPuertas()
    {
        ImageIcon i = createImageIcon("/imagenes/Puerta Arriba Abierta.jpg");
        //poner imagen a puerta 1
        ImageIcon tmpIcon = new ImageIcon(i.getImage().getScaledInstance(this.jLabelPuerta1.getWidth(), this.jLabelPuerta1.getHeight(), Image.SCALE_DEFAULT));
        this.jLabelPuerta1.setIcon(tmpIcon);
//        this.ventanaPrincipal.setjLabelPuerta1(jLabelPuerta1);
        //poner imagen puerta 2
        tmpIcon = new ImageIcon(i.getImage().getScaledInstance(this.jLabelPuerta2.getWidth(), this.jLabelPuerta2.getHeight(), Image.SCALE_DEFAULT));
        this.jLabelPuerta2.setIcon(tmpIcon);
//        this.ventanaPrincipal.setjLabelPuerta2(jLabelPuerta2);
        //poner imagen puerta 3
        tmpIcon = new ImageIcon(i.getImage().getScaledInstance(this.jLabelPuerta3.getWidth(), this.jLabelPuerta3.getHeight(), Image.SCALE_DEFAULT));
        this.jLabelPuerta3.setIcon(tmpIcon);
//        this.ventanaPrincipal.setjLabelPuerta3(jLabelPuerta3);
        i = createImageIcon("/imagenes/Puerta Abajo Abierta.jpg");
        tmpIcon = new ImageIcon(i.getImage().getScaledInstance(this.jLabelPuerta4.getWidth(), this.jLabelPuerta4.getHeight(), Image.SCALE_DEFAULT));
        this.jLabelPuerta4.setIcon(tmpIcon);
//        this.ventanaPrincipal.setjLabelPuerta4(jLabelPuerta4);
        i = createImageIcon("/imagenes/Puerta Izquierda Abierta.jpg");
        tmpIcon = new ImageIcon(i.getImage().getScaledInstance(this.jLabelPuerta5.getWidth(), this.jLabelPuerta5.getHeight(), Image.SCALE_DEFAULT));
        this.jLabelPuerta5.setIcon(tmpIcon);
//        this.ventanaPrincipal.setjLabelPuerta5(jLabelPuerta5);
        this.jLabelPuerta6.setIcon(tmpIcon);
//        this.ventanaPrincipal.setjLabelPuerta6(jLabelPuerta6);
        i = createImageIcon("/imagenes/Puerta Doble Abierta.jpg");
        tmpIcon = new ImageIcon(i.getImage().getScaledInstance(this.jLabelPuerta7.getWidth(), this.jLabelPuerta7.getHeight(), Image.SCALE_DEFAULT));
        this.jLabelPuerta7.setIcon(tmpIcon);
//        this.ventanaPrincipal.setjLabelPuerta7(jLabelPuerta7);
    }

    private void inicializarPersianas()
    {
        ImageIcon i = createImageIcon("/imagenes/Ventana Vertical Cerrada.jpg");
        ImageIcon tmpIcon = new ImageIcon(i.getImage().getScaledInstance(this.jLabelVentana1.getWidth(), this.jLabelVentana1.getHeight(), Image.SCALE_DEFAULT));
        this.jLabelVentana1.setIcon(tmpIcon);
//        this.ventanaPrincipal.setjLabelVentana1(jLabelVentana1);
        tmpIcon = new ImageIcon(i.getImage().getScaledInstance(this.jLabelVentana2.getWidth(), this.jLabelVentana2.getHeight(), Image.SCALE_DEFAULT));
        this.jLabelVentana2.setIcon(tmpIcon);
//        this.ventanaPrincipal.setjLabelVentana2(jLabelVentana2);
        tmpIcon = new ImageIcon(i.getImage().getScaledInstance(this.jLabelVentana3.getWidth(), this.jLabelVentana3.getHeight(), Image.SCALE_DEFAULT));
        this.jLabelVentana3.setIcon(tmpIcon);
//        this.ventanaPrincipal.setjLabelVentana3(jLabelVentana3);
        i = createImageIcon("/imagenes/Ventana Horizontal Cerrada.jpg");
        tmpIcon = new ImageIcon(i.getImage().getScaledInstance(this.jLabelVentana4.getWidth(), this.jLabelVentana4.getHeight(), Image.SCALE_DEFAULT));
        this.jLabelVentana4.setIcon(tmpIcon);
//        this.ventanaPrincipal.setjLabelVentana4(jLabelVentana4);
    }

    public JLabel getjLabelPuerta1() {
        return jLabelPuerta1;
    }

    public JLabel getjLabelPuerta2() {
        return jLabelPuerta2;
    }

    public JLabel getjLabelPuerta3() {
        return jLabelPuerta3;
    }

    public JLabel getjLabelPuerta4() {
        return jLabelPuerta4;
    }

    public JLabel getjLabelPuerta5() {
        return jLabelPuerta5;
    }

    public JLabel getjLabelPuerta6() {
        return jLabelPuerta6;
    }

    public JLabel getjLabelPuerta7() {
        return jLabelPuerta7;
    }

    public JLabel getjLabelVentana1() {
        return jLabelVentana1;
    }

    public JLabel getjLabelVentana2() {
        return jLabelVentana2;
    }

    public JLabel getjLabelVentana3() {
        return jLabelVentana3;
    }

    public JLabel getjLabelVentana4() {
        return jLabelVentana4;
    }

    
    public javax.swing.JSlider getMedidorLuz()
    {
        return this.jSliderIntensidadLuz;
    }

    public JSlider getjSliderTemperatura() {
        return jSliderTemperaturaAmbiente;
    }

    public void escribirComando(String comando)
    {
        this.jTextFieldComando.setText("");
        this.jTextFieldComando.setText(comando);
    }
    
    public void escribirObjeto(String objeto)
    {
        this.jTextFieldObjeto.setText("");
        this.jTextFieldObjeto.setText(objeto);
    }
    
    public void escribirParametros(String parametros)
    {
        this.jTextFieldParametro.setText("");
        this.jTextFieldParametro.setText(parametros);
    }
    
    public void limpiarComando()
    {
        this.jTextFieldComando.setText("");
        this.jTextFieldObjeto.setText("");
        this.jTextFieldParametro.setText("");
    }
    
    public void escribirPalabra(String palabra)
    {
        this.jList1.add(palabra, null);
    }

    public Panel getPanel2() {
        return panel2;
    }

    public JSlider getjSliderIntensidadLuz() {
        return jSliderIntensidadLuz;
    }

    public JSlider getjSliderIntesidadLuzAmbiente() {
        return jSliderIntesidadLuzAmbiente;
    }

    public JSlider getjSliderTemperaturaAmbiente() {
        return jSliderTemperaturaAmbiente;
    }
    
    public JList getJListPalabras()
    {
        return this.jList1;
    }
    
    public void mostrarNombrePerfil(String perfil)
    {
        this.jLabelNombrePerfil.setText(perfil);
    }
    
    public void mostrarIntensidadLuz(int intensidad)
    {
        this.jSliderIntensidadLuz.setValue(intensidad);
        this.jSliderIntensidadLuz.repaint();
    }

    public JSlider getjSliderTemperaturaInterior() {
        return jSliderTemperaturaInterior;
    }
    
    

}
